from flask_sqlalchemy import SQLAlchemy
import json

db = SQLAlchemy()

# 定义 Config 模型类
class Config(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    db_base_url = db.Column(db.String(255))
    db_api_key = db.Column(db.String(255))
    azure_ttsapi_key = db.Column(db.String(255))
    azure_region = db.Column(db.String(50))


# 定义 MData 模型类
class MData(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    azure_voice_name = db.Column(db.String(50))
    init_prompt = db.Column(db.Text)
    # 对于列表和字典类型，我们可以将其转换为 JSON 字符串存储
    video_scripts = db.Column(db.Text)
    cnlunar_str = db.Column(db.Text)
    prompts = db.Column(db.Text)
    days = db.Column(db.Integer)